import { Controller, Get, Param, UseInterceptors } from '@nestjs/common';
import { UserService } from './user.service';
import { CacheInterceptor } from '@nestjs/cache-manager';

@Controller('user')
@UseInterceptors(CacheInterceptor)
export class UserController {
  constructor(private readonly userService: UserService) {}

  @Get(':id/profile')
  async getProfile(@Param('id') userId: string) {
    return this.userService.getUserProfile(userId);
  }

  @Get(':id/orders')
  async getUserOrder(@Param('id') userId: string) {
    return this.userService.getUserOrders(userId);
  }

}
